package at.irian.jsfatwork.broker.domain.account;

import java.math.BigDecimal;

/**
 * @author Thomas Spiegl
 */
class ClearingAccountBalance {

    private BigDecimal balance = BigDecimal.ZERO;

    void add(BigDecimal amount) {
        balance = balance.add(amount);
    }

    void subtract(BigDecimal amount) {
        balance = balance.subtract(amount);
    }

    public boolean isCovered(BigDecimal amount) {
        return balance.compareTo(amount) > 0;
    }

    public BigDecimal getBalance() {
        return balance;
    }

}
